package com.insuremonitor.web.controller.system;

import com.insuremonitor.common.core.controller.BaseController;
import com.insuremonitor.common.core.domain.AjaxResult;
import com.insuremonitor.common.core.page.TableDataInfo;
import com.insuremonitor.system.domain.FrontWarrantyInsure;
import com.insuremonitor.system.domain.UpInfoVo;
import com.insuremonitor.system.service.IFrontWarrantyInsureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 保险投保信息Controller
 * 
 * @author ruoyi
 * @date 2023-11-22
 */
@RestController
@RequestMapping("/warranty/insure")
public class WarrantyInsureController extends BaseController
{
    @Autowired
    private IFrontWarrantyInsureService frontWarrantyInsureService;


    /**
     * 获取所有立案件列表
     * @param frontWarrantyInsure
     * @return
     */
    @GetMapping("/list")
    public TableDataInfo list(FrontWarrantyInsure frontWarrantyInsure)
    {
        startPage();
        List<FrontWarrantyInsure> list = frontWarrantyInsureService.selectFrontWarrantyInsureList(frontWarrantyInsure);

        return getDataTable(list);
    }


    /**
     * 获取保险投保信息详细信息
     */
    @GetMapping(value = "/{warrantyId}")
    public AjaxResult getInfo(@PathVariable("warrantyId") Long warrantyId)
    {
        return success(frontWarrantyInsureService.selectFrontWarrantyInsureByWarrantyId(warrantyId));
    }


    /**
     * 上传保险订单号和订单url
     */
    @PostMapping("/upInfo")
    public AjaxResult upInfo(@RequestBody UpInfoVo  upInfoVo)
    {
        return  frontWarrantyInsureService.upInfo(upInfoVo);
    }



}
